<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="bundle.umd.js"></script>
    <style>
        html,
        body,
        div {
            margin: 0;
            padding: 0;
        }

        .input-file {
            position: relative;
            display: flex;
            cursor: pointer;
            width: 100%;
            padding: 10px 0;
            justify-content: center;
            border-bottom: 1px solid #333;
        }

        .input-file input {
            color: transparent;
            background-color: transparent;
            border: none;
            outline: none;
            width: 100%;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            font-size: 100px;
            z-index: 2;
            opacity: 0;
            cursor: pointer;
        }

        #test {
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="input-file">
        <span>请选择文件</span>
        <input type="file" id="file" />
    </div>
    <div id="test"></div>
    <script>
        (function () {
            const showDom = document.querySelector('#test')

            var inputDom = document.querySelector('#file');
            inputDom.addEventListener('change', function (e) {
                document.querySelector('#test').innerHTML = "正在解析文件..."
                var files = e.target.files;
                if (BEST_OFD && files[0]) {
                    console.dir('BEST_OFD:', BEST_OFD)
                    BEST_OFD.getSVGDoms({ file: files[0], content: document.querySelector('#test') })
                }
                var readFile = new FileReader();

            })

        })()
    </script>
</body>

</html>